﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace com.ReinforceLab.AudioModem
{
    /// <summary>
    /// Audio physical interface
    /// </summary>
    public interface IAudioPHY : IDisposable
    {
        /// <summary>
        /// Audio interface running flag
        /// </summary>
        bool IsRunning { get; }

        /// <summary>
        /// Sampling rate
        /// </summary>
        int SamplingRate { get; }

        /// <summary>
        /// Send/Receive queue buffer length (packet size)
        /// </summary>
        int BufferLength { get; }

        /// <summary>
        /// Sender must fill buffer more than this 
        /// </summary>
        int MinimumBufferFillLength { get; }

        /// <summary>
        /// Does this interface support data output function?
        /// </summary>
        bool CanWrite { get; }

        /// <summary>
        /// Does this interface support data input function?
        /// </summary>
        bool CanRead { get; }

        /// <summary>
        /// Start writing to / reading from the audio interface
        /// </summary>
        void Start(IAudioSource source);

        /// <summary>
        /// stop accessing to the audio interface
        /// </summary>
        void Stop(bool shouldStopImmediate);
    }
}
